import Vue from "vue";
import VueRouter from "vue-router";
import Home from "@/pages/Home.vue";
import About from "@/pages/About.vue";
import NewsList from "@/pages/NewsList.vue";
import FilmList from "@/pages/FilmList.vue";
import Detail from "@/pages/Detail.vue";
Vue.use(VueRouter);
const router = new VueRouter({
    mode:"history",
    routes:[
        {
        path:"/home",
        component:Home,
        children:[
            {
                path:"/home",
                redirect:"/home/films"
            },
            {
                path:"/home/news",
                component:NewsList
            },{
                path:"/home/films",
                component:FilmList,
                children:[
                    {
                        path:"/home/films/:id",
                        component:Detail
                    }
                ]
            }
        ]
    },{
        path:"/about",
        component:About
    },{
        path:"/",
        redirect:"/home"
    }]


});
export default router;